<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('审核服务商')" />
    <th:block th:include="include :: ztree-css" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-audit-update" style="white-space:nowrap;">
        <div class="row">
            <div class="col-sm-12">
                <div class="form-group">
                    <label class="col-xs-2 control-label">审核状态：</label>
                    <div class="col-xs-10" style="margin-top: -6px;" id="status">
                        <label class="radio-box"> <input type="radio" name="status" value="1"/> 通过 </label>
                        <label class="radio-box"> <input type="radio" name="status" value="2"/> 打回</label>
                    </div>
                </div>
            </div>
        </div>
        <input type="hidden" name="agentNum" th:value="${agentNum}">
        <input type="hidden" name="agentStatus" th:value="${agentStatus}">

        <div class="row" id="dh">
            <div class="col-sm-12">
                <div class="form-group">
                    <label class="col-xs-2 control-label">审核备注：</label>
                    <div class="col-xs-10">
                        <textarea name="note" maxlength="100" class="form-control" rows="3"></textarea>
                    </div>
                </div>
            </div>
        </div>

    </form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: ztree-js" />
<script type="text/javascript">
    var prefix = ctx + "agentInfo/agentInfo";
    function submitHandler() {
            add();
    }

    function add() {
        var id = $("input[name='id']").val();
        var state = $("input[name='state']").val();
        var status = $('input[name="status"]:checked ').val();
        if(typeof(status) == "undefined"){
            $.modal.alertError("请选择审核状态!");
            return;
        }
        $.ajax({
            cache : true,
            type : "POST",
            url : prefix + "/audit",
            data : $("#form-audit-update").serialize(),
            async : false,
            error : function(request) {
                $.modal.alertError("系统错误");
            },
            success : function(data) {
                $.operate.successCallback(data);
            }
        });
        $.modal.closeLoading();
    }
</script>
</body>
</html>
